# If you run this shell first, you shall CHMOD the cfg.sh. Like below:
# chmod +x cfg.sh
# Then CHDIR and run cfg.sh. It will get all ip configurations done.
# cd /home/storage/config/yaml/ && ./cfg.sh

myip="192.168.2.113"
myip=`who am i | awk '{print $NF}' | sed -e 's/[()]//g'`
echo ====myip=${myip}

sed -i 's/type_run: [0-1]/type_run: 1/g' config.yaml
sed -i 's/om_img: [0-1]/om_img: 0/g' config.yaml
sed -i 's/gui_ip: 192.168.2.[0-9]*/gui_ip: '"$myip"'/g' config.yaml
sed -i 's/gui_port: [0-9]*/gui_port: 9001/g' config.yaml
sed -i 's/plc_ip: 192.168.2.[0-9]*/plc_ip: '"$myip"'/g' config.yaml
sed -i 's/plc_port: [0-9]*/plc_port: 2001/g' config.yaml
sed -i 's/grpc_port: 192.168.[0-9]*.[0-9]*:.[0-9]*/grpc_port: 192.168.2.74:9001/g' config.yaml